package com.gitee.feizns.zxw.web.controller.api;

import com.gitee.feizns.web.domain.result.Ret;
import com.gitee.feizns.web.mvc.validate.annotation.Exists;
import com.gitee.feizns.zxw.domain.pojo.DestinationAttractions;
import com.gitee.feizns.zxw.domain.portal.vo.destination.attractions.recommend.attractions.ListVo;
import com.gitee.feizns.zxw.service.api.ApiDestinationAttractionsRecommendAccommodationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 详情页 => 目的地 => 景区 => 推荐住宿
 * @author feizns
 * @since 2019/9/10
 */
@Validated
@RestController
@RequestMapping("/api/v1/portal/destination/attractions/recommend/accommodation")
public class ApiDestinationAttractionsRecommendAccommodationController {

    @Autowired
    private ApiDestinationAttractionsRecommendAccommodationService apiDestinationAttractionsRecommendAccommodationService;

    /**
     * 指定景区的推荐住宿
     * @return com.gitee.feizns.zxw.domain.portal.vo.destination.attractions.recommend.attractions.ListVo
     */
    @GetMapping
    public Ret<List<ListVo>> list(@PathVariable @Exists(DestinationAttractions.class) Integer id) {
        return Ret.ok(apiDestinationAttractionsRecommendAccommodationService.list(id));
    }

}
